package com.lucun.es_transaction.mapper;
import com.lucun.es_transaction.entity.Commodity;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CommodityMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Commodity commodity);//商品添加/发布

    int insertSelective(Commodity commodity);
    int selectnumber(int comNumber);//商品编号查询商品数量
    int selectsale(int comNumber);//商品编号查询商品销售量

    Commodity selectByPrimaryKey(Commodity commodity);//商品信息查询id
    Commodity selectAll(Commodity commodity);//查询所有商品默认排序/关键字

    Commodity selectBynumber(Commodity commodity);//商品信息查询number

    Commodity selectBycategory(Commodity commodity);//商品类别查询

    List<Commodity> selectByname(Commodity commodity);//商品商品名称关键字查询默认排序
    List<Commodity> selectBynamesale(Commodity commodity);//商品商品名称关键字查询销量排序
    List<Commodity> selectBynameeva(Commodity commodity);//商品商品名称关键字查询评论量排序


    List<Commodity> getuserId();//查询个人发布的商品
    List<Commodity> selectBynameASC(Commodity commodity);//商品商品名称关键字查询价格升序排列

    List<Commodity> selectBynameDESC(Commodity commodity);//商品商品名称关键字查询价格降序排列
    int updateByPrimaryKeySelective(Commodity record);//商品信息修改
    int updateBytotal(Commodity record);//商品数量修改

    int updateByPrimaryKey(Commodity record);//商品下架

    //获取所有的商品信息
    List<Commodity> getProductList(@Param("sqlId") String sqlId);

}